(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[    189865,       4075]
NotebookOptionsPosition[    180319,       3816]
NotebookOutlinePosition[    180988,       3839]
CellTagsIndexPosition[    180945,       3836]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["FFB Functional Flow Block Diagram Components", "Title",
 CellChangeTimes->{{3.520873834546875*^9, 3.520873840984375*^9}, {
  3.520880951484375*^9, 3.520880952703125*^9}, {3.563716915219516*^9, 
  3.563716924939933*^9}, {3.571923819762748*^9, 3.5719238276407614`*^9}}],

Cell[CellGroupData[{

Cell["General", "Section",
 CellChangeTimes->{{3.5719269675877132`*^9, 3.5719269908317537`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}]}], "Input",
 CellChangeTimes->{
  3.522605694171875*^9, 3.571926984357743*^9, {3.571927056273869*^9, 
   3.571927057397071*^9}}],

Cell[BoxData[
 RowBox[{"<<", "C:\\\\Hopsan\\Compgen\\CompgenNG06.mx"}]], "Input",
 CellChangeTimes->{{3.525533906765625*^9, 3.525533914734375*^9}, 
   3.577601924150117*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"path", "=", 
   RowBox[{"ToFileName", "[", 
    RowBox[{"{", 
     RowBox[{
     "\"\<C:\>\"", ",", "\"\<HopsanTrunk\>\"", ",", "\"\<HOPSAN++\>\"", ",", 
      "\"\<componentLibraries\>\"", ",", "\"\<defaultLibrary\>\"", ",", 
      "\"\<Special\>\"", ",", "\"\<SignalFFB\>\""}], "}"}], "]"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.5757727777685804`*^9, 3.575772792541806*^9}, {
   3.5757728423954945`*^9, 3.5757728498367076`*^9}, {3.57577333888545*^9, 
   3.5757733706315055`*^9}, 3.5757734316206255`*^9, {3.575776746610216*^9, 
   3.57577674854722*^9}, {3.5758034373456383`*^9, 3.5758034687537785`*^9}, {
   3.576215299790524*^9, 3.576215340163597*^9}, {3.5762155444425898`*^9, 
   3.576215547684914*^9}, 3.5762159940865498`*^9, 3.5762161254666862`*^9, {
   3.576244738757578*^9, 3.5762447467603917`*^9}, {3.5764733859773207`*^9, 
   3.576473408313554*^9}}],

Cell[BoxData[
 RowBox[{"Off", "[", 
  RowBox[{"General", "::", "\"\<spell1\>\""}], "]"}]], "Input",
 PageWidth->WindowWidth]
}, Open  ]],

Cell[CellGroupData[{

Cell["Functional Flow Block FFB", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
  3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
  3.529584814875*^9}, {3.5297706328125*^9, 3.529770669484375*^9}, {
  3.529771030046875*^9, 3.529771032171875*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<FFB\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<Functional Flow Block\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, {3.5297706786875*^9, 
   3.529770689359375*^9}, 3.576473460419764*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "set", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<On trigger\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exit", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Off trigger, jump to 0 ,signal to next block\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exitb", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Off trigger, jump to 0 ,signal to next block\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "leave", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Off trigger, jump to 0\>\""}], "}"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529748772071517*^9, 3.529748868907278*^9}, {3.529748922841757*^9, 
   3.529748947895595*^9}, {3.52977081503125*^9, 3.529770819078125*^9}, 
   3.529773193640625*^9, {3.5566105831954803`*^9, 3.5566106709454803`*^9}, {
   3.5637787076990776`*^9, 3.5637787122605333`*^9}, {3.5637790477840824`*^9, 
   3.5637790541447186`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "state", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<State activated\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exiting", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<jumping to alt 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exitingb", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<jumping to alt 0\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.5297486899434547`*^9, 3.5297487423274183`*^9}, {3.5297488146188493`*^9, 
   3.5297488285774975`*^9}, {3.529748882652526*^9, 3.5297489070972*^9}, {
   3.529748960844243*^9, 3.5297489658893743`*^9}, {3.5297527498964505`*^9, 
   3.5297527523964825`*^9}, 3.529753797663*^9, 3.529770756453125*^9, 
   3.52977226925*^9, 3.529773306*^9, {3.5637787296842756`*^9, 
   3.5637787528045874`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting", "==", "exiting"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExit", "==", "exit"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldLeave", "==", "leave"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, {3.5297489818213663`*^9, 3.5297489918491497`*^9}, {
   3.5297490280397625`*^9, 3.5297490984529195`*^9}, 3.52975340033291*^9, 
   3.529753892117334*^9, {3.529770726109375*^9, 3.52977074746875*^9}, {
   3.52977319496875*^9, 3.529773222125*^9}, {3.529773265078125*^9, 
   3.529773268046875*^9}, {3.529773307078125*^9, 3.529773333796875*^9}, {
   3.529773522140625*^9, 3.529773522625*^9}, {3.5566106796954803`*^9, 
   3.5566106944454803`*^9}, {3.5719248419857435`*^9, 3.57192486845899*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"exitT", "=", 
   RowBox[{"exit", "+", "exitb"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5637787877080774`*^9, 3.563778807292036*^9}, {
  3.563779027230027*^9, 3.563779039716276*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"state", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"set", "-", "oldSet", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"exitT", "-", "oldExit", "-", "0.5"}], "]"}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"leave", "-", "oldLeave", "-", "0.5"}], "]"}], "-", "0.5"}], 
       "]"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"exiting", "==", 
      RowBox[{"oldState", "*", 
       RowBox[{"onPositive", "[", 
        RowBox[{"exit", "-", "oldExit", "-", "0.5"}], "]"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"exitingb", "==", "exiting"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldSet", "==", "set"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting", "==", "exiting"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExit", "==", "exit"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldLeave", "==", "leave"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529749154152413*^9, 3.5297493297873654`*^9}, {3.5297493764851103`*^9, 
   3.5297493775474877`*^9}, {3.5297501019704385`*^9, 
   3.5297501136886635`*^9}, {3.52975014478102*^9, 3.5297502127163706`*^9}, {
   3.52975024574741*^9, 3.5297502695910068`*^9}, {3.529750311121991*^9, 
   3.529750403355776*^9}, {3.5297521386269016`*^9, 3.5297522392203035`*^9}, {
   3.529752271642386*^9, 3.529752273439273*^9}, {3.5297525566908526`*^9, 
   3.529752587738125*^9}, {3.529752711630336*^9, 3.529752779146825*^9}, {
   3.529753426161035*^9, 3.529753491629785*^9}, {3.5297538718514495`*^9, 
   3.5297538795234227`*^9}, {3.529755012763733*^9, 3.529755017670046*^9}, {
   3.5297552331385436`*^9, 3.529755235857276*^9}, {3.5297564195083323`*^9, 
   3.529756420195828*^9}, {3.529756798975916*^9, 3.529756804710327*^9}, {
   3.5297569476174917`*^9, 3.5297569486018734`*^9}, {3.52977070015625*^9, 
   3.529770712859375*^9}, {3.529773124703125*^9, 3.529773134078125*^9}, {
   3.529773211953125*^9, 3.529773246375*^9}, {3.52977331234375*^9, 
   3.529773335703125*^9}, {3.5566105163517303`*^9, 3.5566105756017303`*^9}, 
   3.563778780503357*^9, {3.5637788208533916`*^9, 3.563778837724079*^9}, 
   3.563778993476652*^9, 3.563779068329137*^9, {3.5719248768518047`*^9, 
   3.5719249116242657`*^9}, 3.57192494269952*^9, {3.571925169648719*^9, 
   3.5719251752803288`*^9}, 3.5764738749752965`*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454734715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.5776024547367153`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454737715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Set :: \
noval\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454738715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\\"SignalFFB\\\"\\)\\), \
\\(\\(\\\"displayname\\\" \[Rule] \\\"SignalFFB\\\"\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalFFB.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \\\"SignalFFB.svg\\\"\\)\\)}\
\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpositions\
\\\", \\(\\({}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] 0.2`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"set\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.4`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \
\\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"exit\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(\[LeftSkeleton] 3 \[RightSkeleton]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.5\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"exiting\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.75\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"exitingb\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \
\\(\\({\\(\\(\\\"\\\" \[Ellipsis] \\\"\\\"\\)\\) \[Rule] \\(\\(\\\"\\\" \
\[Ellipsis] \\\"\\\"\\)\\)}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\\(\\\"typename\\\" \
\[Rule] \\\"SignalFFB\\\"\\)\\), \\(\\(\\\"displayname\\\" \[Rule] \\(\\(\\\"\
\\\" \[Ellipsis] \\\"B\\\"\\)\\)\\)\\)}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\
\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \[Rule] \
\\\"SignalFFB.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\
\\), \\(\\(\\\"userpath\\\" \[Rule] \\\"SignalFFB.svg\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \
\\(\\({}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\
\\\"x\\\" \[Rule] 0.2`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\
\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"set\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.4`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \
\\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"exit\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(\[LeftSkeleton] 3 \[RightSkeleton]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.5\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"exiting\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.75\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"exitingb\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454739715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454740715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.2`\\)\[NoBreak] in \[NoBreak]\\!\\(\\\"x\
\\\" \[Rule] 0.2`\\)\[NoBreak] is not a valid value for an attribute in an \
XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454740715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454741715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.4`\\)\[NoBreak] in \[NoBreak]\\!\\(\\\"x\
\\\" \[Rule] 0.4`\\)\[NoBreak] is not a valid value for an attribute in an \
XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454741715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454742715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.577602454742715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6000000000000001`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.6000000000000001`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.5776024547437153`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \
\[NoBreak]\\!\\(\\*StyleBox[\\(XMLElement :: attrhs\\), \
\\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this calculation. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/stop\\\", \
ButtonNote -> \\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.52977165690625*^9, 
   3.529772273640625*^9, 3.529772797609375*^9, 3.529772966046875*^9, 
   3.52977335846875*^9, 3.5297737819375*^9, 3.529773990609375*^9, 
   3.529774144140625*^9, 3.529855898390625*^9, {3.554785673120239*^9, 
   3.5547856992287784`*^9}, 3.5764736415352964`*^9, 3.577450755135562*^9, 
   3.5776024547437153`*^9}],

Cell[BoxData["\<\"SignalFFB.xml\"\>"], "Output",
 CellChangeTimes->{{3.5547856731358633`*^9, 3.554785699244403*^9}, 
   3.5764736415692964`*^9, 3.5774507551685653`*^9, 3.5776024547447147`*^9}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["FFBD AND(out)", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
   3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
   3.529584814875*^9}, {3.52977099734375*^9, 3.5297709990625*^9}, 
   3.52977103446875*^9, 3.52977178784375*^9, {3.5298127727244825`*^9, 
   3.5298127743181095`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<FFBand\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<FFBD AND\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, {3.5297710045625*^9, 
   3.529771038203125*^9}, {3.5297717775*^9, 3.5297717781875*^9}, 
   3.529771948640625*^9, 3.576473469219644*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "in0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "in1", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 1\>\""}], "}"}]}], "\n", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529748772071517*^9, 3.529748868907278*^9}, {3.529748922841757*^9, 
   3.529748947895595*^9}, {3.529773921640625*^9, 3.529773923125*^9}, {
   3.52977733546875*^9, 3.52977738715625*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "state", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<State activated\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exiting", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.5297486899434547`*^9, 3.5297487423274183`*^9}, {3.5297488146188493`*^9, 
   3.5297488285774975`*^9}, {3.529748882652526*^9, 3.5297489070972*^9}, {
   3.529748960844243*^9, 3.5297489658893743`*^9}, {3.5297527498964505`*^9, 
   3.5297527523964825`*^9}, 3.529753797663*^9, {3.529773923578125*^9, 
   3.529773930625*^9}, {3.529774491203125*^9, 3.52977449446875*^9}, 
   3.529774541140625*^9}],

Cell["\<\
initialExpressions = {
  {oldIn0, in0, double, \"\", \"old state\"},
  {oldIn1, in1, double, \"\", \"old state\"},
  {oldExiting, exiting, double, \"\", \"old state\"}
  }\
\>", "Text",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, {3.5297489818213663`*^9, 3.5297489918491497`*^9}, {
   3.5297490280397625`*^9, 3.5297490984529195`*^9}, 3.52975340033291*^9, 
   3.529753892117334*^9, {3.529773932125*^9, 3.52977393471875*^9}, {
   3.529773964984375*^9, 3.5297739668125*^9}, {3.52977410634375*^9, 
   3.529774133140625*^9}, 3.529774259265625*^9, {3.52977740078125*^9, 
   3.52977741459375*^9}, 3.571923980926631*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn1", "==", "in1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting", "==", "exiting"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, {3.5297489818213663`*^9, 3.5297489918491497`*^9}, {
   3.5297490280397625`*^9, 3.5297490984529195`*^9}, 3.52975340033291*^9, 
   3.529753892117334*^9, {3.529773932125*^9, 3.52977393471875*^9}, {
   3.529773964984375*^9, 3.5297739668125*^9}, {3.52977410634375*^9, 
   3.529774133140625*^9}, 3.529774259265625*^9, {3.52977740078125*^9, 
   3.52977741459375*^9}, {3.571924002548269*^9, 3.5719240267907114`*^9}, 
   3.5719248126108913`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"state0", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState0", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"in0", "-", "oldIn0", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"oldExiting", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], 
     ",", "\[IndentingNewLine]", 
     RowBox[{"state1", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState1", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"in1", "-", "oldIn1", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"oldExiting", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], 
     ",", "\[IndentingNewLine]", 
     RowBox[{"exiting", "==", 
      RowBox[{"oldState0", "*", "oldState1"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"state", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"state0", "-", "0.5"}], "]"}], "+", 
        RowBox[{"onPositive", "[", 
         RowBox[{"state1", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"oldState0", "==", "state0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldState1", "==", "state1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn1", "==", "in1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting", "==", "exiting"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529749154152413*^9, 3.5297493297873654`*^9}, {3.5297493764851103`*^9, 
   3.5297493775474877`*^9}, {3.5297501019704385`*^9, 
   3.5297501136886635`*^9}, {3.52975014478102*^9, 3.5297502127163706`*^9}, {
   3.52975024574741*^9, 3.5297502695910068`*^9}, {3.529750311121991*^9, 
   3.529750403355776*^9}, {3.5297521386269016`*^9, 3.5297522392203035`*^9}, {
   3.529752271642386*^9, 3.529752273439273*^9}, {3.5297525566908526`*^9, 
   3.529752587738125*^9}, {3.529752711630336*^9, 3.529752779146825*^9}, {
   3.529753426161035*^9, 3.529753491629785*^9}, {3.5297538718514495`*^9, 
   3.5297538795234227`*^9}, {3.529755012763733*^9, 3.529755017670046*^9}, {
   3.5297552331385436`*^9, 3.529755235857276*^9}, {3.5297564195083323`*^9, 
   3.529756420195828*^9}, {3.529756798975916*^9, 3.529756804710327*^9}, {
   3.5297569476174917`*^9, 3.5297569486018734`*^9}, {3.52977108628125*^9, 
   3.529771189671875*^9}, {3.52977122428125*^9, 3.5297712398125*^9}, {
   3.529771271046875*^9, 3.52977150390625*^9}, {3.529773945515625*^9, 
   3.529773976859375*^9}, {3.52977437296875*^9, 3.529774391671875*^9}, {
   3.529777104984375*^9, 3.529777119546875*^9}, {3.529777434890625*^9, 
   3.529777497703125*^9}, 3.5298146759060464`*^9, {3.5719240313303194`*^9, 
   3.571924097646036*^9}, {3.5719251958879647`*^9, 3.571925200567973*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.529771658109375*^9, 
   3.529771793671875*^9, 3.5297719526875*^9, 3.529772797796875*^9, 
   3.52977296621875*^9, 3.529773358578125*^9, 3.529773751921875*^9, 
   3.52977378209375*^9, 3.529773990703125*^9, 3.52977414428125*^9, 
   3.5297744035*^9, 3.5297745046875*^9, 3.529774544375*^9, 
   3.52977712953125*^9, 3.529777520453125*^9, 3.529821447497023*^9, 
   3.5298230578075647`*^9, 3.52985589846875*^9, {3.5547856732296104`*^9, 
   3.5547856992912765`*^9}, 3.5764736416592965`*^9, 3.57745075531558*^9, 
   3.577602454844715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.529771658109375*^9, 
   3.529771793671875*^9, 3.5297719526875*^9, 3.529772797796875*^9, 
   3.52977296621875*^9, 3.529773358578125*^9, 3.529773751921875*^9, 
   3.52977378209375*^9, 3.529773990703125*^9, 3.52977414428125*^9, 
   3.5297744035*^9, 3.5297745046875*^9, 3.529774544375*^9, 
   3.52977712953125*^9, 3.529777520453125*^9, 3.529821447497023*^9, 
   3.5298230578075647`*^9, 3.52985589846875*^9, {3.5547856732296104`*^9, 
   3.5547856992912765`*^9}, 3.5764736416592965`*^9, 3.57745075531558*^9, 
   3.577602454845715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\\"SignalFFBand\\\"\\)\\), \
\\(\\(\\\"displayname\\\" \[Rule] \\(\\(\\\"\\\" \[Ellipsis] \
\\\"\\\"\\)\\)\\)\\)}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"SignalFFBand.svg\\\"\\)\\), \\(\\(\\\
\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"SignalFFBand.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] 0.3333333333333333`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"in0\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"in1\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.333333\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"state\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\
\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0.666667\\\"\\)\\), \
\\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \
\\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"exiting\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \
\\(\\({\\(\\(\\\"\\\" \[Ellipsis] \\\"n\\\"\\)\\) \[Rule] \\(\\(\\\"\\\" \
\[Ellipsis] \\\"\\\"\\)\\)}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"SignalFFBand.svg\\\"\\)\\), \\(\\(\\\
\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"SignalFFBand.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] 0.3333333333333333`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"in0\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"in1\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.333333\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"state\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\
\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0.666667\\\"\\)\\), \
\\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \
\\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"exiting\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.529771658109375*^9, 
   3.529771793671875*^9, 3.5297719526875*^9, 3.529772797796875*^9, 
   3.52977296621875*^9, 3.529773358578125*^9, 3.529773751921875*^9, 
   3.52977378209375*^9, 3.529773990703125*^9, 3.52977414428125*^9, 
   3.5297744035*^9, 3.5297745046875*^9, 3.529774544375*^9, 
   3.52977712953125*^9, 3.529777520453125*^9, 3.529821447497023*^9, 
   3.5298230578075647`*^9, 3.52985589846875*^9, {3.5547856732296104`*^9, 
   3.5547856992912765`*^9}, 3.5764736416592965`*^9, 3.57745075531558*^9, 
   3.577602454846715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.529771658109375*^9, 
   3.529771793671875*^9, 3.5297719526875*^9, 3.529772797796875*^9, 
   3.52977296621875*^9, 3.529773358578125*^9, 3.529773751921875*^9, 
   3.52977378209375*^9, 3.529773990703125*^9, 3.52977414428125*^9, 
   3.5297744035*^9, 3.5297745046875*^9, 3.529774544375*^9, 
   3.52977712953125*^9, 3.529777520453125*^9, 3.529821447497023*^9, 
   3.5298230578075647`*^9, 3.52985589846875*^9, {3.5547856732296104`*^9, 
   3.5547856992912765`*^9}, 3.5764736416592965`*^9, 3.57745075531558*^9, 
   3.577602454847715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.529771658109375*^9, 
   3.529771793671875*^9, 3.5297719526875*^9, 3.529772797796875*^9, 
   3.52977296621875*^9, 3.529773358578125*^9, 3.529773751921875*^9, 
   3.52977378209375*^9, 3.529773990703125*^9, 3.52977414428125*^9, 
   3.5297744035*^9, 3.5297745046875*^9, 3.529774544375*^9, 
   3.52977712953125*^9, 3.529777520453125*^9, 3.529821447497023*^9, 
   3.5298230578075647`*^9, 3.52985589846875*^9, {3.5547856732296104`*^9, 
   3.5547856992912765`*^9}, 3.5764736416592965`*^9, 3.57745075531558*^9, 
   3.577602454848715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.529771658109375*^9, 
   3.529771793671875*^9, 3.5297719526875*^9, 3.529772797796875*^9, 
   3.52977296621875*^9, 3.529773358578125*^9, 3.529773751921875*^9, 
   3.52977378209375*^9, 3.529773990703125*^9, 3.52977414428125*^9, 
   3.5297744035*^9, 3.5297745046875*^9, 3.529774544375*^9, 
   3.52977712953125*^9, 3.529777520453125*^9, 3.529821447497023*^9, 
   3.5298230578075647`*^9, 3.52985589846875*^9, {3.5547856732296104`*^9, 
   3.5547856992912765`*^9}, 3.5764736416592965`*^9, 3.57745075531558*^9, 
   3.577602454849715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.529771658109375*^9, 
   3.529771793671875*^9, 3.5297719526875*^9, 3.529772797796875*^9, 
   3.52977296621875*^9, 3.529773358578125*^9, 3.529773751921875*^9, 
   3.52977378209375*^9, 3.529773990703125*^9, 3.52977414428125*^9, 
   3.5297744035*^9, 3.5297745046875*^9, 3.529774544375*^9, 
   3.52977712953125*^9, 3.529777520453125*^9, 3.529821447497023*^9, 
   3.5298230578075647`*^9, 3.52985589846875*^9, {3.5547856732296104`*^9, 
   3.5547856992912765`*^9}, 3.5764736416592965`*^9, 3.57745075531558*^9, 
   3.5776024548507147`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.529771658109375*^9, 
   3.529771793671875*^9, 3.5297719526875*^9, 3.529772797796875*^9, 
   3.52977296621875*^9, 3.529773358578125*^9, 3.529773751921875*^9, 
   3.52977378209375*^9, 3.529773990703125*^9, 3.52977414428125*^9, 
   3.5297744035*^9, 3.5297745046875*^9, 3.529774544375*^9, 
   3.52977712953125*^9, 3.529777520453125*^9, 3.529821447497023*^9, 
   3.5298230578075647`*^9, 3.52985589846875*^9, {3.5547856732296104`*^9, 
   3.5547856992912765`*^9}, 3.5764736416592965`*^9, 3.57745075531558*^9, 
   3.577602454851715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.529587592859375*^9, 3.529587762125*^9, 3.529588266328125*^9, 
   3.529588317625*^9, 3.52958839228125*^9, 3.529590223828125*^9, 
   3.529752800068968*^9, 3.52975349902041*^9, 3.529771658109375*^9, 
   3.529771793671875*^9, 3.5297719526875*^9, 3.529772797796875*^9, 
   3.52977296621875*^9, 3.529773358578125*^9, 3.529773751921875*^9, 
   3.52977378209375*^9, 3.529773990703125*^9, 3.52977414428125*^9, 
   3.5297744035*^9, 3.5297745046875*^9, 3.529774544375*^9, 
   3.52977712953125*^9, 3.529777520453125*^9, 3.529821447497023*^9, 
   3.5298230578075647`*^9, 3.52985589846875*^9, {3.5547856732296104`*^9, 
   3.5547856992912765`*^9}, 3.5764736416592965`*^9, 3.57745075531558*^9, 
   3.577602454852715*^9}],

Cell[BoxData["\<\"SignalFFBand.xml\"\>"], "Output",
 CellChangeTimes->{{3.5547856732608595`*^9, 3.554785699322525*^9}, 
   3.5764736417002964`*^9, 3.5774507553215804`*^9, 3.577602454853715*^9}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["FFBD AND(in)", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
   3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
   3.529584814875*^9}, {3.52977099734375*^9, 3.5297709990625*^9}, 
   3.52977103446875*^9, 3.52977178784375*^9, {3.5298127683654423`*^9, 
   3.529812769115384*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<FFBandIn\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<FFBD AND(in)\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, {3.5297710045625*^9, 
   3.529771038203125*^9}, {3.5297717775*^9, 3.5297717781875*^9}, 
   3.529771948640625*^9, {3.529812783379914*^9, 3.529812789504443*^9}, 
   3.5764734749002123`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{
     "in0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
      "\"\<Input 0\>\""}], "}"}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529748772071517*^9, 3.529748868907278*^9}, {3.529748922841757*^9, 
   3.529748947895595*^9}, {3.529773921640625*^9, 3.529773923125*^9}, {
   3.52977733546875*^9, 3.52977738715625*^9}, {3.5298127968163815`*^9, 
   3.529812797785057*^9}, {3.529822576551029*^9, 3.5298225769415092`*^9}, {
   3.52982271926647*^9, 3.529822719813229*^9}, 3.529822838631879*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "state", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<State activated\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "out0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "out1", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.5297486899434547`*^9, 3.5297487423274183`*^9}, {3.5297488146188493`*^9, 
   3.5297488285774975`*^9}, {3.529748882652526*^9, 3.5297489070972*^9}, {
   3.529748960844243*^9, 3.5297489658893743`*^9}, {3.5297527498964505`*^9, 
   3.5297527523964825`*^9}, 3.529753797663*^9, {3.529773923578125*^9, 
   3.529773930625*^9}, {3.529774491203125*^9, 3.52977449446875*^9}, 
   3.529774541140625*^9, {3.529812827814001*^9, 3.5298128502029066`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut0", "==", "out0"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, {3.5297489818213663`*^9, 3.5297489918491497`*^9}, {
   3.5297490280397625`*^9, 3.5297490984529195`*^9}, 3.52975340033291*^9, 
   3.529753892117334*^9, {3.529773932125*^9, 3.52977393471875*^9}, {
   3.529773964984375*^9, 3.5297739668125*^9}, {3.52977410634375*^9, 
   3.529774133140625*^9}, 3.529774259265625*^9, {3.52977740078125*^9, 
   3.52977741459375*^9}, {3.5298128565930405`*^9, 3.5298128740448256`*^9}, {
   3.5298130407432613`*^9, 3.5298130426650867`*^9}, {3.5298131397407265`*^9, 
   3.5298131443968573`*^9}, 3.5547858007880287`*^9, {3.571924109782857*^9, 
   3.571924128814891*^9}, 3.5719252118467927`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"state", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"in0", "-", "oldIn0", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"oldOut0", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"out0", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"out1", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut0", "==", "out0"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529749154152413*^9, 3.5297493297873654`*^9}, {3.5297493764851103`*^9, 
   3.5297493775474877`*^9}, {3.5297501019704385`*^9, 
   3.5297501136886635`*^9}, {3.52975014478102*^9, 3.5297502127163706`*^9}, {
   3.52975024574741*^9, 3.5297502695910068`*^9}, {3.529750311121991*^9, 
   3.529750403355776*^9}, {3.5297521386269016`*^9, 3.5297522392203035`*^9}, {
   3.529752271642386*^9, 3.529752273439273*^9}, {3.5297525566908526`*^9, 
   3.529752587738125*^9}, {3.529752711630336*^9, 3.529752779146825*^9}, {
   3.529753426161035*^9, 3.529753491629785*^9}, {3.5297538718514495`*^9, 
   3.5297538795234227`*^9}, {3.529755012763733*^9, 3.529755017670046*^9}, {
   3.5297552331385436`*^9, 3.529755235857276*^9}, {3.5297564195083323`*^9, 
   3.529756420195828*^9}, {3.529756798975916*^9, 3.529756804710327*^9}, {
   3.5297569476174917`*^9, 3.5297569486018734`*^9}, {3.52977108628125*^9, 
   3.529771189671875*^9}, {3.52977122428125*^9, 3.5297712398125*^9}, {
   3.529771271046875*^9, 3.52977150390625*^9}, {3.529773945515625*^9, 
   3.529773976859375*^9}, {3.52977437296875*^9, 3.529774391671875*^9}, {
   3.529777104984375*^9, 3.529777119546875*^9}, {3.529777434890625*^9, 
   3.529777497703125*^9}, {3.529812897934417*^9, 3.5298130448525305`*^9}, {
   3.529813119725614*^9, 3.529813129881604*^9}, {3.529821168261525*^9, 
   3.529821171072567*^9}, 3.52985667278125*^9, {3.571924143088916*^9, 
   3.5719241794525795`*^9}, {3.571925138464264*^9, 3.571925140164667*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736417782965`*^9, 3.5774507554545937`*^9, 
  3.577602454964715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\\"SignalFFBandIn\\\"\\)\\), \
\\(\\(\\\"displayname\\\" \[Rule] \\\"SignalFFBandIn\\\"\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalFFBandIn.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"SignalFFBandIn.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] 0.5`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"in0\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.25\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"state\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\
\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0.5\\\"\\)\\), \\(\\(\
\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"out0\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0.75\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\
\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"out1\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \
\\(\\({\\(\\(\\\"\\\" \[Ellipsis] \\\"\\\"\\)\\) \[Rule] \\(\\(\\\"\\\" \
\[Ellipsis] \\\"\\\"\\)\\)}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\\(\\\"typename\\\" \
\[Rule] \\\"SignalFFBandIn\\\"\\)\\), \\(\\(\\\"displayname\\\" \[Rule] \
\\(\\(\\\"Si\\\" \[Ellipsis] \\\"In\\\"\\)\\)\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalFFBandIn.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"SignalFFBandIn.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] 0.5`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"in0\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.25\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"state\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\
\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0.5\\\"\\)\\), \\(\\(\
\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"out0\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0.75\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\
\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"out1\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736417782965`*^9, 3.5774507554545937`*^9, 
  3.577602454965715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736417782965`*^9, 3.5774507554545937`*^9, 
  3.577602454966715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.5`\\)\[NoBreak] in \[NoBreak]\\!\\(\\\"x\
\\\" \[Rule] 0.5`\\)\[NoBreak] is not a valid value for an attribute in an \
XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736417782965`*^9, 3.5774507554545937`*^9, 
  3.5776024549677153`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736417782965`*^9, 3.5774507554545937`*^9, 
  3.5776024549687147`*^9}],

Cell[BoxData["\<\"SignalFFBandIn.xml\"\>"], "Output",
 CellChangeTimes->{{3.5547856733546066`*^9, 3.554785699400648*^9}, 
   3.5547858786605363`*^9, 3.5764736418062963`*^9, 3.5774507554585943`*^9, 
   3.5776024549867153`*^9}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["FFBD OR(in)", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
   3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
   3.529584814875*^9}, {3.52977099734375*^9, 3.5297709990625*^9}, 
   3.52977103446875*^9, 3.52977178784375*^9, {3.5298127683654423`*^9, 
   3.529812769115384*^9}, {3.529855020078125*^9, 3.529855020828125*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<FFBorIn\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<FFBD or in\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, {3.5297710045625*^9, 
   3.529771038203125*^9}, {3.5297717775*^9, 3.5297717781875*^9}, 
   3.529771948640625*^9, {3.529812783379914*^9, 3.529812789504443*^9}, {
   3.529855732828125*^9, 3.52985573959375*^9}, {3.52995025240625*^9, 
   3.5299502576875*^9}, 3.576473480091731*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "in0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "divert", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 0\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529748772071517*^9, 3.529748868907278*^9}, {3.529748922841757*^9, 
   3.529748947895595*^9}, {3.529773921640625*^9, 3.529773923125*^9}, {
   3.52977733546875*^9, 3.52977738715625*^9}, {3.5298127968163815`*^9, 
   3.529812797785057*^9}, {3.529822576551029*^9, 3.5298225769415092`*^9}, {
   3.52982271926647*^9, 3.529822719813229*^9}, 3.529822838631879*^9, {
   3.529855048265625*^9, 3.529855078796875*^9}, {3.529859408703125*^9, 
   3.529859409671875*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "state", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<State activated\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "out0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "out1", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.5297486899434547`*^9, 3.5297487423274183`*^9}, {3.5297488146188493`*^9, 
   3.5297488285774975`*^9}, {3.529748882652526*^9, 3.5297489070972*^9}, {
   3.529748960844243*^9, 3.5297489658893743`*^9}, {3.5297527498964505`*^9, 
   3.5297527523964825`*^9}, 3.529753797663*^9, {3.529773923578125*^9, 
   3.529773930625*^9}, {3.529774491203125*^9, 3.52977449446875*^9}, 
   3.529774541140625*^9, {3.529812827814001*^9, 3.5298128502029066`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut0", "==", "out0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut1", "==", "out1"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, {3.5297489818213663`*^9, 3.5297489918491497`*^9}, {
   3.5297490280397625`*^9, 3.5297490984529195`*^9}, 3.52975340033291*^9, 
   3.529753892117334*^9, {3.529773932125*^9, 3.52977393471875*^9}, {
   3.529773964984375*^9, 3.5297739668125*^9}, {3.52977410634375*^9, 
   3.529774133140625*^9}, 3.529774259265625*^9, {3.52977740078125*^9, 
   3.52977741459375*^9}, {3.5298128565930405`*^9, 3.5298128740448256`*^9}, {
   3.5298130407432613`*^9, 3.5298130426650867`*^9}, {3.5298131397407265`*^9, 
   3.5298131443968573`*^9}, 3.5298552241875*^9, {3.52985801465625*^9, 
   3.529858020671875*^9}, {3.529859386203125*^9, 3.529859421453125*^9}, {
   3.52986338596875*^9, 3.529863386375*^9}, {3.5719241911994004`*^9, 
   3.571924206939828*^9}, 3.5719244077433805`*^9, 3.571924989842803*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"state", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"in0", "-", "oldIn0", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"oldOut0", "+", "oldOut1", "-", "0.5"}], "]"}], "-", "0.5"}],
        "]"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"out0", "==", 
      RowBox[{"state", "*", 
       RowBox[{"onPositive", "[", 
        RowBox[{"1", "-", "divert", "-", "0.5"}], "]"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"out1", "==", 
      RowBox[{"state", "*", 
       RowBox[{"onPositive", "[", 
        RowBox[{"divert", "-", "0.5"}], "]"}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut0", "==", "out0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut1", "==", "out1"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529749154152413*^9, 3.5297493297873654`*^9}, {3.5297493764851103`*^9, 
   3.5297493775474877`*^9}, {3.5297501019704385`*^9, 
   3.5297501136886635`*^9}, {3.52975014478102*^9, 3.5297502127163706`*^9}, {
   3.52975024574741*^9, 3.5297502695910068`*^9}, {3.529750311121991*^9, 
   3.529750403355776*^9}, {3.5297521386269016`*^9, 3.5297522392203035`*^9}, {
   3.529752271642386*^9, 3.529752273439273*^9}, {3.5297525566908526`*^9, 
   3.529752587738125*^9}, {3.529752711630336*^9, 3.529752779146825*^9}, {
   3.529753426161035*^9, 3.529753491629785*^9}, {3.5297538718514495`*^9, 
   3.5297538795234227`*^9}, {3.529755012763733*^9, 3.529755017670046*^9}, {
   3.5297552331385436`*^9, 3.529755235857276*^9}, {3.5297564195083323`*^9, 
   3.529756420195828*^9}, {3.529756798975916*^9, 3.529756804710327*^9}, {
   3.5297569476174917`*^9, 3.5297569486018734`*^9}, {3.52977108628125*^9, 
   3.529771189671875*^9}, {3.52977122428125*^9, 3.5297712398125*^9}, {
   3.529771271046875*^9, 3.52977150390625*^9}, {3.529773945515625*^9, 
   3.529773976859375*^9}, {3.52977437296875*^9, 3.529774391671875*^9}, {
   3.529777104984375*^9, 3.529777119546875*^9}, {3.529777434890625*^9, 
   3.529777497703125*^9}, {3.529812897934417*^9, 3.5298130448525305`*^9}, {
   3.529813119725614*^9, 3.529813129881604*^9}, {3.529821168261525*^9, 
   3.529821171072567*^9}, {3.5298551205625*^9, 3.529855208953125*^9}, 
   3.529856836171875*^9, 3.52985815678125*^9, {3.529859429921875*^9, 
   3.529859430671875*^9}, {3.571924211136235*^9, 3.571924252601108*^9}, 
   3.571924405528177*^9, {3.5719251263586426`*^9, 3.571925129899849*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736418802967`*^9, 3.577450755598608*^9, 
  3.5776024550787153`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736418802967`*^9, 3.577450755598608*^9, 
  3.577602455079715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalFFBorIn.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \\\"SignalFFBorIn.svg\\\"\\)\
\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \
\\(\\({\\(\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\\), \\(\\(\\\"y\\\" \
\[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"in0\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\
\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"divert\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.25\\\"\\)\\), \\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"state\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0.5\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
\\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \
\[Rule] \\\"out0\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.75\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"out1\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \
\\(\\({\\\"version\\\" \[Rule] \\\"0.1\\\"}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\\(\\\"typename\\\" \
\[Rule] \\\"SignalFFBorIn\\\"\\)\\), \\(\\(\\\"displayname\\\" \[Rule] \
\\\"SignalFFBorIn\\\"\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalFFBorIn.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \\\"SignalFFBorIn.svg\\\"\\)\
\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\[NoBreak] is not a list \
of contents. The third item in an XMLElement must be a list of contents, even \
if it is an empty list. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736418802967`*^9, 3.577450755598608*^9, 
  3.577602455080715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736418802967`*^9, 3.577450755598608*^9, 
  3.577602455080715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736418802967`*^9, 3.577450755598608*^9, 
  3.577602455081715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736418802967`*^9, 3.577450755598608*^9, 
  3.577602455082715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736418802967`*^9, 3.577450755598608*^9, 
  3.577602455082715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736418802967`*^9, 3.577450755598608*^9, 
  3.577602455083715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736418802967`*^9, 3.577450755598608*^9, 
  3.577602455083715*^9}],

Cell[BoxData["\<\"SignalFFBorIn.xml\"\>"], "Output",
 CellChangeTimes->{{3.5547856734483533`*^9, 3.5547856994787703`*^9}, 
   3.576473641902296*^9, 3.5774507556046085`*^9, 3.577602455084715*^9}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["FFBD OR(out)", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
   3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
   3.529584814875*^9}, {3.52977099734375*^9, 3.5297709990625*^9}, 
   3.52977103446875*^9, 3.52977178784375*^9, {3.5298127727244825`*^9, 
   3.5298127743181095`*^9}, {3.52985578275*^9, 3.529855783359375*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<FFBor\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<FFBD OR out\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, {3.5297710045625*^9, 
   3.529771038203125*^9}, {3.5297717775*^9, 3.5297717781875*^9}, 
   3.529771948640625*^9, {3.529856261328125*^9, 3.529856270265625*^9}, 
   3.5764734852442465`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "in0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "in1", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 1\>\""}], "}"}]}], "\n", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529748772071517*^9, 3.529748868907278*^9}, {3.529748922841757*^9, 
   3.529748947895595*^9}, {3.529773921640625*^9, 3.529773923125*^9}, {
   3.52977733546875*^9, 3.52977738715625*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "state", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<State activated\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exiting", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exitingb0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exitingb1", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.5297486899434547`*^9, 3.5297487423274183`*^9}, {3.5297488146188493`*^9, 
   3.5297488285774975`*^9}, {3.529748882652526*^9, 3.5297489070972*^9}, {
   3.529748960844243*^9, 3.5297489658893743`*^9}, {3.5297527498964505`*^9, 
   3.5297527523964825`*^9}, 3.529753797663*^9, {3.529773923578125*^9, 
   3.529773930625*^9}, {3.529774491203125*^9, 3.52977449446875*^9}, 
   3.529774541140625*^9, {3.5637788892712326`*^9, 3.5637789079060965`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn1", "==", "in1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting", "==", "exiting"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, {3.5297489818213663`*^9, 3.5297489918491497`*^9}, {
   3.5297490280397625`*^9, 3.5297490984529195`*^9}, 3.52975340033291*^9, 
   3.529753892117334*^9, {3.529773932125*^9, 3.52977393471875*^9}, {
   3.529773964984375*^9, 3.5297739668125*^9}, {3.52977410634375*^9, 
   3.529774133140625*^9}, 3.529774259265625*^9, {3.52977740078125*^9, 
   3.52977741459375*^9}, {3.571924272023142*^9, 3.571924289526373*^9}, 
   3.57192440158137*^9, 3.571925226167618*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"state0", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState0", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"in0", "-", "oldIn0", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"oldExiting", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], 
     ",", "\[IndentingNewLine]", 
     RowBox[{"state1", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState1", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"in1", "-", "oldIn1", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"oldExiting", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], 
     ",", "\[IndentingNewLine]", 
     RowBox[{"exiting", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{"oldState0", "+", "oldState1", "-", "0.5"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"state", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"state0", "-", "0.5"}], "]"}], "+", 
        RowBox[{"onPositive", "[", 
         RowBox[{"state1", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"oldState0", "==", "state0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldState1", "==", "state1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn1", "==", "in1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting", "==", "exiting"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529749154152413*^9, 3.5297493297873654`*^9}, {3.5297493764851103`*^9, 
   3.5297493775474877`*^9}, {3.5297501019704385`*^9, 
   3.5297501136886635`*^9}, {3.52975014478102*^9, 3.5297502127163706`*^9}, {
   3.52975024574741*^9, 3.5297502695910068`*^9}, {3.529750311121991*^9, 
   3.529750403355776*^9}, {3.5297521386269016`*^9, 3.5297522392203035`*^9}, {
   3.529752271642386*^9, 3.529752273439273*^9}, {3.5297525566908526`*^9, 
   3.529752587738125*^9}, {3.529752711630336*^9, 3.529752779146825*^9}, {
   3.529753426161035*^9, 3.529753491629785*^9}, {3.5297538718514495`*^9, 
   3.5297538795234227`*^9}, {3.529755012763733*^9, 3.529755017670046*^9}, {
   3.5297552331385436`*^9, 3.529755235857276*^9}, {3.5297564195083323`*^9, 
   3.529756420195828*^9}, {3.529756798975916*^9, 3.529756804710327*^9}, {
   3.5297569476174917`*^9, 3.5297569486018734`*^9}, {3.52977108628125*^9, 
   3.529771189671875*^9}, {3.52977122428125*^9, 3.5297712398125*^9}, {
   3.529771271046875*^9, 3.52977150390625*^9}, {3.529773945515625*^9, 
   3.529773976859375*^9}, {3.52977437296875*^9, 3.529774391671875*^9}, {
   3.529777104984375*^9, 3.529777119546875*^9}, {3.529777434890625*^9, 
   3.529777497703125*^9}, 3.5298146759060464`*^9, {3.5298558249375*^9, 
   3.52985584878125*^9}, {3.57192429356678*^9, 3.5719243368880563`*^9}, 
   3.571924398991765*^9, {3.571925114019021*^9, 3.571925118340229*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736419762964`*^9, 3.5774507557416224`*^9, 
  3.577602455179715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736419762964`*^9, 3.5774507557416224`*^9, 
  3.577602455180715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalFFBor.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"SignalFFBor.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] 0.3333333333333333`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"in0\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"in1\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\
\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\
\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0.6\\\"\\)\\), \\(\\(\\\"y\
\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"exitingb0\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0.8\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
\\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \
\[Rule] \\\"exitingb1\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\
\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \
\\(\\({\\\"version\\\" \[Rule] \\\"0.1\\\"}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\\(\\\"typename\\\" \
\[Rule] \\\"SignalFFBor\\\"\\)\\), \\(\\(\\\"displayname\\\" \[Rule] \
\\\"SignalFFBor\\\"\\)\\)}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"SignalFFBor.svg\\\"\\)\\), \
\\(\\(\\\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \
\[Rule] \\\"SignalFFBor.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736419762964`*^9, 3.5774507557416224`*^9, 
  3.577602455181715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736419762964`*^9, 3.5774507557416224`*^9, 
  3.577602455181715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736419762964`*^9, 3.5774507557416224`*^9, 
  3.577602455182715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736419762964`*^9, 3.5774507557416224`*^9, 
  3.577602455182715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736419762964`*^9, 3.5774507557416224`*^9, 
  3.577602455183715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736419762964`*^9, 3.5774507557416224`*^9, 
  3.5776024551847153`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736419762964`*^9, 3.5774507557416224`*^9, 
  3.5776024551847153`*^9}],

Cell[BoxData["\<\"SignalFFBor.xml\"\>"], "Output",
 CellChangeTimes->{{3.5547856735421004`*^9, 3.5547856995725174`*^9}, 
   3.5764736419952965`*^9, 3.577450755748623*^9, 3.5776024551857147`*^9}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["FFBD Loop(in)", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
   3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
   3.529584814875*^9}, {3.52977099734375*^9, 3.5297709990625*^9}, 
   3.52977103446875*^9, 3.52977178784375*^9, {3.5298127727244825`*^9, 
   3.5298127743181095`*^9}, {3.52985578275*^9, 3.529855783359375*^9}, {
   3.529950138765625*^9, 3.529950144078125*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<FFBloopIn\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<FFBD Loop in\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, {3.5297710045625*^9, 
   3.529771038203125*^9}, {3.5297717775*^9, 3.5297717781875*^9}, 
   3.529771948640625*^9, {3.529856261328125*^9, 3.529856270265625*^9}, {
   3.52995015525*^9, 3.52995017946875*^9}, 3.576473491900912*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "in0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "in1", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 1\>\""}], "}"}]}], "\n", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529748772071517*^9, 3.529748868907278*^9}, {3.529748922841757*^9, 
   3.529748947895595*^9}, {3.529773921640625*^9, 3.529773923125*^9}, {
   3.52977733546875*^9, 3.52977738715625*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "state", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<State activated\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exiting", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.5297486899434547`*^9, 3.5297487423274183`*^9}, {3.5297488146188493`*^9, 
   3.5297488285774975`*^9}, {3.529748882652526*^9, 3.5297489070972*^9}, {
   3.529748960844243*^9, 3.5297489658893743`*^9}, {3.5297527498964505`*^9, 
   3.5297527523964825`*^9}, 3.529753797663*^9, {3.529773923578125*^9, 
   3.529773930625*^9}, {3.529774491203125*^9, 3.52977449446875*^9}, 
   3.529774541140625*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn1", "==", "in1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting", "==", "exiting"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, {3.5297489818213663`*^9, 3.5297489918491497`*^9}, {
   3.5297490280397625`*^9, 3.5297490984529195`*^9}, 3.52975340033291*^9, 
   3.529753892117334*^9, {3.529773932125*^9, 3.52977393471875*^9}, {
   3.529773964984375*^9, 3.5297739668125*^9}, {3.52977410634375*^9, 
   3.529774133140625*^9}, 3.529774259265625*^9, {3.52977740078125*^9, 
   3.52977741459375*^9}, {3.5719243603972974`*^9, 3.5719243939061565`*^9}, 
   3.5719252381484394`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"state0", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState0", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"in0", "-", "oldIn0", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"oldExiting", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], 
     ",", "\[IndentingNewLine]", 
     RowBox[{"state1", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState1", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"in1", "-", "oldIn1", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"oldExiting", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], 
     ",", "\[IndentingNewLine]", 
     RowBox[{"exiting", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{"oldState0", "+", "oldState1", "-", "0.5"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"state", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"state0", "-", "0.5"}], "]"}], "+", 
        RowBox[{"onPositive", "[", 
         RowBox[{"state1", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"oldState0", "==", "state0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldState1", "==", "state1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn1", "==", "in1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting", "==", "exiting"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529749154152413*^9, 3.5297493297873654`*^9}, {3.5297493764851103`*^9, 
   3.5297493775474877`*^9}, {3.5297501019704385`*^9, 
   3.5297501136886635`*^9}, {3.52975014478102*^9, 3.5297502127163706`*^9}, {
   3.52975024574741*^9, 3.5297502695910068`*^9}, {3.529750311121991*^9, 
   3.529750403355776*^9}, {3.5297521386269016`*^9, 3.5297522392203035`*^9}, {
   3.529752271642386*^9, 3.529752273439273*^9}, {3.5297525566908526`*^9, 
   3.529752587738125*^9}, {3.529752711630336*^9, 3.529752779146825*^9}, {
   3.529753426161035*^9, 3.529753491629785*^9}, {3.5297538718514495`*^9, 
   3.5297538795234227`*^9}, {3.529755012763733*^9, 3.529755017670046*^9}, {
   3.5297552331385436`*^9, 3.529755235857276*^9}, {3.5297564195083323`*^9, 
   3.529756420195828*^9}, {3.529756798975916*^9, 3.529756804710327*^9}, {
   3.5297569476174917`*^9, 3.5297569486018734`*^9}, {3.52977108628125*^9, 
   3.529771189671875*^9}, {3.52977122428125*^9, 3.5297712398125*^9}, {
   3.529771271046875*^9, 3.52977150390625*^9}, {3.529773945515625*^9, 
   3.529773976859375*^9}, {3.52977437296875*^9, 3.529774391671875*^9}, {
   3.529777104984375*^9, 3.529777119546875*^9}, {3.529777434890625*^9, 
   3.529777497703125*^9}, 3.5298146759060464`*^9, {3.5298558249375*^9, 
   3.52985584878125*^9}, {3.57192442417021*^9, 3.571924480891909*^9}, {
   3.571925013242844*^9, 3.5719250197948556`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736420672965`*^9, 3.577450755889637*^9, 
  3.577602455282715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736420672965`*^9, 3.577450755889637*^9, 
  3.5776024552837152`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\\"SignalFFBloopIn\\\"\\)\\), \
\\(\\(\\(\\(\\\"di\\\" \[Ellipsis] \\\"me\\\"\\)\\) \[Rule] \\(\\(\\\"\\\" \
\[Ellipsis] \\\"\\\"\\)\\)\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalFFBloopIn.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"SignalFFBloopIn.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] 0.3333333333333333`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"in0\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"in1\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.333333\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"state\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\
\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0.666667\\\"\\)\\), \
\\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \
\\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"exiting\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\[NoBreak] is not a list \
of contents. The third item in an XMLElement must be a list of contents, even \
if it is an empty list. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736420672965`*^9, 3.577450755889637*^9, 
  3.5776024552847147`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736420672965`*^9, 3.577450755889637*^9, 
  3.577602455285715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736420672965`*^9, 3.577450755889637*^9, 
  3.577602455285715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736420672965`*^9, 3.577450755889637*^9, 
  3.577602455286715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736420672965`*^9, 3.577450755889637*^9, 
  3.577602455286715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736420672965`*^9, 3.577450755889637*^9, 
  3.577602455287715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736420672965`*^9, 3.577450755889637*^9, 
  3.577602455287715*^9}],

Cell[BoxData["\<\"SignalFFBloopIn.xml\"\>"], "Output",
 CellChangeTimes->{{3.554785673651472*^9, 3.5547856996506395`*^9}, 
   3.5764736420902967`*^9, 3.577450755896638*^9, 3.577602455288715*^9}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["FFBD Loop(out)", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
   3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
   3.529584814875*^9}, {3.52977099734375*^9, 3.5297709990625*^9}, 
   3.52977103446875*^9, 3.52977178784375*^9, {3.5298127683654423`*^9, 
   3.529812769115384*^9}, {3.529855020078125*^9, 3.529855020828125*^9}, {
   3.529950118234375*^9, 3.529950124828125*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<FFBloop\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<FFBD loop out\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, {3.5297710045625*^9, 
   3.529771038203125*^9}, {3.5297717775*^9, 3.5297717781875*^9}, 
   3.529771948640625*^9, {3.529812783379914*^9, 3.529812789504443*^9}, {
   3.529855732828125*^9, 3.52985573959375*^9}, {3.529950193609375*^9, 
   3.529950233375*^9}, 3.576473496996421*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "in0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "divert", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Input 0\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529748772071517*^9, 3.529748868907278*^9}, {3.529748922841757*^9, 
   3.529748947895595*^9}, {3.529773921640625*^9, 3.529773923125*^9}, {
   3.52977733546875*^9, 3.52977738715625*^9}, {3.5298127968163815`*^9, 
   3.529812797785057*^9}, {3.529822576551029*^9, 3.5298225769415092`*^9}, {
   3.52982271926647*^9, 3.529822719813229*^9}, 3.529822838631879*^9, {
   3.529855048265625*^9, 3.529855078796875*^9}, {3.529859408703125*^9, 
   3.529859409671875*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "state", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<State activated\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "out0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "out1", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.5297486899434547`*^9, 3.5297487423274183`*^9}, {3.5297488146188493`*^9, 
   3.5297488285774975`*^9}, {3.529748882652526*^9, 3.5297489070972*^9}, {
   3.529748960844243*^9, 3.5297489658893743`*^9}, {3.5297527498964505`*^9, 
   3.5297527523964825`*^9}, 3.529753797663*^9, {3.529773923578125*^9, 
   3.529773930625*^9}, {3.529774491203125*^9, 3.52977449446875*^9}, 
   3.529774541140625*^9, {3.529812827814001*^9, 3.5298128502029066`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut0", "==", "out0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut1", "==", "out1"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, {3.5297489818213663`*^9, 3.5297489918491497`*^9}, {
   3.5297490280397625`*^9, 3.5297490984529195`*^9}, 3.52975340033291*^9, 
   3.529753892117334*^9, {3.529773932125*^9, 3.52977393471875*^9}, {
   3.529773964984375*^9, 3.5297739668125*^9}, {3.52977410634375*^9, 
   3.529774133140625*^9}, 3.529774259265625*^9, {3.52977740078125*^9, 
   3.52977741459375*^9}, {3.5298128565930405`*^9, 3.5298128740448256`*^9}, {
   3.5298130407432613`*^9, 3.5298130426650867`*^9}, {3.5298131397407265`*^9, 
   3.5298131443968573`*^9}, 3.5298552241875*^9, {3.52985801465625*^9, 
   3.529858020671875*^9}, {3.529859386203125*^9, 3.529859421453125*^9}, {
   3.52986338596875*^9, 3.529863386375*^9}, {3.5719244896747246`*^9, 
   3.5719245172555733`*^9}, 3.571924559328847*^9, {3.5719250270800686`*^9, 
   3.5719250423212953`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"state", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"in0", "-", "oldIn0", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"oldOut0", "+", "oldOut1", "-", "0.5"}], "]"}], "-", "0.5"}],
        "]"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"out0", "==", 
      RowBox[{"state", "*", 
       RowBox[{"onPositive", "[", 
        RowBox[{"1", "-", "divert", "-", "0.5"}], "]"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"out1", "==", 
      RowBox[{"state", "*", 
       RowBox[{"onPositive", "[", 
        RowBox[{"divert", "-", "0.5"}], "]"}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldIn0", "==", "in0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut0", "==", "out0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldOut1", "==", "out1"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529749154152413*^9, 3.5297493297873654`*^9}, {3.5297493764851103`*^9, 
   3.5297493775474877`*^9}, {3.5297501019704385`*^9, 
   3.5297501136886635`*^9}, {3.52975014478102*^9, 3.5297502127163706`*^9}, {
   3.52975024574741*^9, 3.5297502695910068`*^9}, {3.529750311121991*^9, 
   3.529750403355776*^9}, {3.5297521386269016`*^9, 3.5297522392203035`*^9}, {
   3.529752271642386*^9, 3.529752273439273*^9}, {3.5297525566908526`*^9, 
   3.529752587738125*^9}, {3.529752711630336*^9, 3.529752779146825*^9}, {
   3.529753426161035*^9, 3.529753491629785*^9}, {3.5297538718514495`*^9, 
   3.5297538795234227`*^9}, {3.529755012763733*^9, 3.529755017670046*^9}, {
   3.5297552331385436`*^9, 3.529755235857276*^9}, {3.5297564195083323`*^9, 
   3.529756420195828*^9}, {3.529756798975916*^9, 3.529756804710327*^9}, {
   3.5297569476174917`*^9, 3.5297569486018734`*^9}, {3.52977108628125*^9, 
   3.529771189671875*^9}, {3.52977122428125*^9, 3.5297712398125*^9}, {
   3.529771271046875*^9, 3.52977150390625*^9}, {3.529773945515625*^9, 
   3.529773976859375*^9}, {3.52977437296875*^9, 3.529774391671875*^9}, {
   3.529777104984375*^9, 3.529777119546875*^9}, {3.529777434890625*^9, 
   3.529777497703125*^9}, {3.529812897934417*^9, 3.5298130448525305`*^9}, {
   3.529813119725614*^9, 3.529813129881604*^9}, {3.529821168261525*^9, 
   3.529821171072567*^9}, {3.5298551205625*^9, 3.529855208953125*^9}, 
   3.529856836171875*^9, 3.52985815678125*^9, {3.529859429921875*^9, 
   3.529859430671875*^9}, {3.5719245210151796`*^9, 3.5719245550700397`*^9}, {
   3.57192503385048*^9, 3.5719250361592846`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736421702967`*^9, 3.5774507563106794`*^9, 
  3.5776024553697147`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736421702967`*^9, 3.5774507563106794`*^9, 
  3.577602455370715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalFFBloop.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \\\"SignalFFBloop.svg\\\"\\)\
\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \
\\(\\({\\(\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\\), \\(\\(\\\"y\\\" \
\[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"in0\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\
\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"divert\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.25\\\"\\)\\), \\(\\(\[LeftSkeleton] 2 \[RightSkeleton]\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"state\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0.5\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
\\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \
\[Rule] \\\"out0\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.75\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"out1\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \
\\(\\({\\\"version\\\" \[Rule] \\\"0.1\\\"}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\\(\\\"typename\\\" \
\[Rule] \\\"SignalFFBloop\\\"\\)\\), \\(\\(\\\"displayname\\\" \[Rule] \
\\\"SignalFFBloop\\\"\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalFFBloop.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \\\"SignalFFBloop.svg\\\"\\)\
\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\[NoBreak] is not a list \
of contents. The third item in an XMLElement must be a list of contents, even \
if it is an empty list. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736421702967`*^9, 3.5774507563106794`*^9, 
  3.577602455384715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736421702967`*^9, 3.5774507563106794`*^9, 
  3.577602455385715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736421702967`*^9, 3.5774507563106794`*^9, 
  3.577602455386715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736421702967`*^9, 3.5774507563106794`*^9, 
  3.577602455386715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736421702967`*^9, 3.5774507563106794`*^9, 
  3.5776024553877153`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736421702967`*^9, 3.5774507563106794`*^9, 
  3.577602455388715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5764736421702967`*^9, 3.5774507563106794`*^9, 
  3.577602455388715*^9}],

Cell[BoxData["\<\"SignalFFBloop.xml\"\>"], "Output",
 CellChangeTimes->{{3.554785673776468*^9, 3.5547856997443867`*^9}, 
   3.5764736421892967`*^9, 3.57745075631768*^9, 3.577602455388715*^9}]
}, Open  ]]
}, Closed]],

Cell["Extra Components", "Subtitle",
 CellChangeTimes->{{3.5764735683985605`*^9, 3.576473569411662*^9}, {
  3.576473601475868*^9, 3.576473608323553*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"path", "=", 
   RowBox[{"ToFileName", "[", 
    RowBox[{"{", 
     RowBox[{
     "\"\<C:\>\"", ",", "\"\<HopsanTrunk\>\"", ",", "\"\<HOPSAN++\>\"", ",", 
      "\"\<componentLibraries\>\"", ",", "\"\<defaultLibrary\>\"", ",", 
      "\"\<Signal\>\"", ",", "\"\<Logic\>\""}], "}"}], "]"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.5757727777685804`*^9, 3.575772792541806*^9}, {
   3.5757728423954945`*^9, 3.5757728498367076`*^9}, {3.57577333888545*^9, 
   3.5757733706315055`*^9}, 3.5757734316206255`*^9, {3.575776746610216*^9, 
   3.57577674854722*^9}, {3.5758034373456383`*^9, 3.5758034687537785`*^9}, {
   3.576215299790524*^9, 3.576215340163597*^9}, {3.5762155444425898`*^9, 
   3.576215547684914*^9}, 3.5762159940865498`*^9, 3.5762161254666862`*^9, {
   3.576244738757578*^9, 3.5762447467603917`*^9}, {3.5764733859773207`*^9, 
   3.576473408313554*^9}, {3.577601778119515*^9, 3.577601802281931*^9}}],

Cell[CellGroupData[{

Cell["StateMachine", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
  3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
  3.529584814875*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<StateMachine\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<Finite state machine\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, 3.5764735025889807`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "set", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<On trigger\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exit0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Off trigger, exit to 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exit1", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Off trigger, exit to 1\>\""}], "}"}]}], "\n", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529748772071517*^9, 3.529748868907278*^9}, {3.529748922841757*^9, 
   3.529748947895595*^9}, {3.52977368775*^9, 3.529773689*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "state", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<State activated\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exiting0", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 0\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "exiting1", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<exiting to alt 1\>\""}], "}"}]}], "\n", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.5297486899434547`*^9, 3.5297487423274183`*^9}, {3.5297488146188493`*^9, 
   3.5297488285774975`*^9}, {3.529748882652526*^9, 3.5297489070972*^9}, {
   3.529748960844243*^9, 3.5297489658893743`*^9}, {3.5297527498964505`*^9, 
   3.5297527523964825`*^9}, 3.529753797663*^9, {3.529773587640625*^9, 
   3.529773591109375*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldSet", "==", "set"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting0", "==", "exiting0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting1", "==", "exiting1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExit1", "==", "exit1"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, {3.5297489818213663`*^9, 3.5297489918491497`*^9}, {
   3.5297490280397625`*^9, 3.5297490984529195`*^9}, 3.52975340033291*^9, 
   3.529753892117334*^9, 3.52977325615625*^9, {3.529773592265625*^9, 
   3.52977364715625*^9}, 3.52977369034375*^9, {3.5719245920889044`*^9, 
   3.5719246183437505`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"exit", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"exit0", "-", "oldExit0", "-", "0.5"}], "]"}], "+", 
        RowBox[{"onPositive", "[", 
         RowBox[{"exit1", "-", "oldExit1", "-", "0.5"}], "]"}], "-", "0.5"}], 
       "]"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"state", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldState", "-", "0.5"}], "]"}], "+", 
        RowBox[{"2", "*", 
         RowBox[{"onPositive", "[", 
          RowBox[{"set", "-", "oldSet", "-", "0.5"}], "]"}]}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"exit", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"exiting0", "==", 
      RowBox[{"oldState", "*", 
       RowBox[{"onPositive", "[", 
        RowBox[{"exit0", "-", "oldExit0", "-", "0.5"}], "]"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"exiting1", "==", 
      RowBox[{"oldState", "*", 
       RowBox[{"onPositive", "[", 
        RowBox[{"exit1", "-", "oldExit1", "-", "0.5"}], "]"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"oldState", "==", "state"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldSet", "==", "set"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting0", "==", "exiting0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExiting1", "==", "exiting1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExit0", "==", "exit0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldExit1", "==", "exit1"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->CompressedData["
1:eJxTTMoPSmViYGCQAWIQzdCgtVbN55UjAwPnBjDd8O0xhJ/2BkIXKKqDaWMd
MN3gZwjhp5tB+MvrIfwbDRBa8zCEjoHSL09C1F09BaInPnAJKQPSkkaWWSCa
rY2/AESzthqC6au8+0+B6A5OszMgWu6fxAUQ3fRm2g0QfeLV9jsguv3lpvsg
Our54ycguiUp+wOInsIfcrIcSO/ieX4VROf2fbkJotv49G6B6HLpaX9B9I55
5YwVQHqb9hcBEH1qU4okiDZWd82C0CVFIFrY/vdCEP1w/4dFILqhYIZBJZBm
KTQ1BNGf81R8QPS5vGow7eRS8ABEW7q0gektVvf5q0D+3z1NAETXHSpWAtE9
TpPBNAPDVucmSDi5QWg+bwgtHwiiH/kevfh8zivHInumGyCaY8dK9hdAetp3
Nw4QDQBnJcqS
  "]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.577602455506715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.577602455506715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.577602455507715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Set :: \
noval\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.5776024555087147`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalStateMachine.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \
\[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"SignalStateMachine.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\
\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] 0.25`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"set\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.5`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \
\\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"exit0\\\"\\)\\)}\\)\\), \\(\
\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\
\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0.5\\\"\\)\\), \\(\\(\
\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"exiting0\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0.75\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\
\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"exiting1\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \
\\(\\({\\\"version\\\" \[Rule] \\\"0.1\\\"}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\\(\\\"typename\\\" \
\[Rule] \\\"SignalStateMachine\\\"\\)\\), \\(\\(\\\"displayname\\\" \[Rule] \
\\\"SignalStateMachine\\\"\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalStateMachine.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \
\[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"SignalStateMachine.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\
\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.5776024555087147`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.577602455509715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.25`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.25`\\)\[NoBreak] is not a valid value for \
an attribute in an XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.577602455510715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.577602455511715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.5`\\)\[NoBreak] in \[NoBreak]\\!\\(\\\"x\
\\\" \[Rule] 0.5`\\)\[NoBreak] is not a valid value for an attribute in an \
XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.577602455511715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.5776024555127153`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.5776024555127153`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.75`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.75`\\)\[NoBreak] is not a valid value for \
an attribute in an XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.577602455513715*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \
\[NoBreak]\\!\\(\\*StyleBox[\\(XMLElement :: attrhs\\), \
\\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this calculation. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/stop\\\", \
ButtonNote -> \\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.577450756481696*^9, 3.577602455513715*^9}],

Cell[BoxData["\<\"SignalStateMachine.xml\"\>"], "Output",
 CellChangeTimes->{
  3.529950271984375*^9, {3.5547856739483376`*^9, 3.554785699806885*^9}, 
   3.5774507565126996`*^9, 3.577602455514715*^9}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["S-R latch", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
  3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
  3.529584814875*^9}, {3.52959633665625*^9, 3.52959634803125*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<SRlatch\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<S-R latch\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, {3.529596354421875*^9, 
   3.529596369015625*^9}, 3.5764735069894204`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "setCond", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<On condition\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "resetCond", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<off condition\>\""}], "}"}]}], "\n", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529596531265625*^9, 3.529596537390625*^9}, {3.529650349909154*^9, 
   3.529650351237194*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\n", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "Qstate", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Logical state\>\""}], "}"}], ",", "\n", 
     RowBox[{"{", 
      RowBox[{
      "notQstate", ",", "1.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Logical inverse of state\>\""}], "}"}]}], "\n", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.52959659559375*^9, 3.529596615265625*^9}, 3.5296472601147585`*^9, {
   3.5296473407948947`*^9, 3.5296473473268137`*^9}, 3.529649459263307*^9, 
   3.590904738943883*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{"oldQstate", "==", "Qstate"}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, 3.5295963953125*^9, {3.529647256989439*^9, 
   3.5296472580207944`*^9}, {3.529647337935227*^9, 3.529647353718093*^9}, {
   3.57192468643787*^9, 3.5719246946278844`*^9}, 3.5719252552148695`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldQstate", "==", "Qstate"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldSetCond", "==", "setCond"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldResetCond", "==", "resetCond"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, 3.5295963953125*^9, {3.529647256989439*^9, 
   3.5296472580207944`*^9}, {3.529647337935227*^9, 3.529647353718093*^9}, {
   3.5296872766875*^9, 3.529687338453125*^9}, {3.529687383921875*^9, 
   3.5296873858125*^9}, {3.5719247270915413`*^9, 3.571924745717974*^9}, 
   3.5719252640444846`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"Qstate", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{
        RowBox[{"onPositive", "[", 
         RowBox[{"oldQstate", "-", "0.5"}], "]"}], "+", 
        RowBox[{"onPositive", "[", 
         RowBox[{"setCond", "-", "0.5"}], "]"}], "-", 
        RowBox[{"onPositive", "[", 
         RowBox[{"resetCond", "-", "0.5"}], "]"}], "-", "0.5"}], "]"}]}], ",",
      "\[IndentingNewLine]", 
     RowBox[{"oldQstate", "==", "Qstate"}], ",", "\[IndentingNewLine]", 
     RowBox[{"notQstate", "==", 
      RowBox[{"1", "-", "Qstate"}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529596403*^9, 3.52959645915625*^9}, {3.529596510671875*^9, 
   3.529596527171875*^9}, {3.5295965615625*^9, 3.529596585640625*^9}, {
   3.5296472501293616`*^9, 3.5296472536140933`*^9}, {3.52964732004277*^9, 
   3.52964737482963*^9}, {3.5296486047915845`*^9, 3.529648605072869*^9}, 
   3.529650357502418*^9, {3.5296505716074257`*^9, 3.5296505771857653`*^9}, {
   3.5719247020846977`*^9, 3.5719247186675267`*^9}, {3.577602623323715*^9, 
   3.5776026269207153`*^9}, {3.5908984708318167`*^9, 3.5908984713828163`*^9}, 
   3.5908985408758163`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"DsetCond", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{"setCond", "-", "oldSetCond"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"DresetCond", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{"resetCond", "-", "oldResetCond"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"Qstate", "\[Equal]", 
      RowBox[{"limit", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"2", " ", 
          RowBox[{"onPositive", "[", 
           RowBox[{"oldQstate", "-", "0.5"}], "]"}]}], "+", 
         RowBox[{"2", " ", 
          RowBox[{"onPositive", "[", 
           RowBox[{"DsetCond", "-", "0.5"}], "]"}]}], "-", 
         RowBox[{"2", " ", 
          RowBox[{"onPositive", "[", 
           RowBox[{"DresetCond", "-", "0.5"}], "]"}]}]}], ",", "0", ",", 
        "1"}], "]"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldQstate", "\[Equal]", "Qstate"}], ",", "\[IndentingNewLine]", 
     RowBox[{"notQstate", "==", 
      RowBox[{"1", "-", "Qstate"}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529596403*^9, 3.52959645915625*^9}, {3.529596510671875*^9, 
   3.529596527171875*^9}, {3.5295965615625*^9, 3.529596585640625*^9}, {
   3.5296472501293616`*^9, 3.5296472536140933`*^9}, {3.52964732004277*^9, 
   3.52964737482963*^9}, {3.5296486047915845`*^9, 3.529648605072869*^9}, 
   3.529650357502418*^9, {3.5296505716074257`*^9, 3.5296505771857653`*^9}, {
   3.529687265359375*^9, 3.529687267546875*^9}, {3.529687403515625*^9, 
   3.529687484203125*^9}, {3.529687527171875*^9, 3.52968755115625*^9}, {
   3.5297491187115407`*^9, 3.529749138767107*^9}, {3.571924759679999*^9, 
   3.571924782643239*^9}, 3.571925072491748*^9, {3.577602445774715*^9, 
   3.577602447837715*^9}, 3.5908985542438164`*^9, {3.5908986701958165`*^9, 
   3.590898684410816*^9}, {3.590898999878015*^9, 3.590899024486476*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5776018794466467`*^9, {3.577601930674769*^9, 3.577601943869088*^9}, 
   3.5776020329629965`*^9, 3.577602221897715*^9, 3.577602274419715*^9, 
   3.577602321340715*^9, 3.577602455745715*^9, 3.5908990766416903`*^9, 
   3.5908991857255983`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5776018794466467`*^9, {3.577601930674769*^9, 3.577601943869088*^9}, 
   3.5776020329629965`*^9, 3.577602221897715*^9, 3.577602274419715*^9, 
   3.577602321340715*^9, 3.577602455745715*^9, 3.5908990766416903`*^9, 
   3.590899185728598*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\\"SignalSRlatch\\\"\\)\\), \
\\(\\(\\\"displayname\\\" \[Rule] \\\"SignalSRlatch\\\"\\)\\)}\\)\\), \\(\\({\
\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \[Rule] \
\\\"SignalSRlatch.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \\\"SignalSRlatch.svg\\\"\\)\
\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] 0.3333333333333333`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"setCond\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"resetCond\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.333333\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"Qstate\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.666667\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"notQstate\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \\(\\({\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\\(\\\"typename\\\" \
\[Rule] \\(\\(\\\"\\\" \[Ellipsis] \\\"\\\"\\)\\)\\)\\), \
\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"SignalSRlatch.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \\\"SignalSRlatch.svg\\\"\\)\
\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] 0.3333333333333333`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"setCond\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"resetCond\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.333333\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"Qstate\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.666667\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"notQstate\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5776018794466467`*^9, {3.577601930674769*^9, 3.577601943869088*^9}, 
   3.5776020329629965`*^9, 3.577602221897715*^9, 3.577602274419715*^9, 
   3.577602321340715*^9, 3.577602455745715*^9, 3.5908990766416903`*^9, 
   3.5908991857476*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5776018794466467`*^9, {3.577601930674769*^9, 3.577601943869088*^9}, 
   3.5776020329629965`*^9, 3.577602221897715*^9, 3.577602274419715*^9, 
   3.577602321340715*^9, 3.577602455745715*^9, 3.5908990766416903`*^9, 
   3.5908991857516003`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5776018794466467`*^9, {3.577601930674769*^9, 3.577601943869088*^9}, 
   3.5776020329629965`*^9, 3.577602221897715*^9, 3.577602274419715*^9, 
   3.577602321340715*^9, 3.577602455745715*^9, 3.5908990766416903`*^9, 
   3.5908991857526007`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5776018794466467`*^9, {3.577601930674769*^9, 3.577601943869088*^9}, 
   3.5776020329629965`*^9, 3.577602221897715*^9, 3.577602274419715*^9, 
   3.577602321340715*^9, 3.577602455745715*^9, 3.5908990766416903`*^9, 
   3.590899185753601*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5776018794466467`*^9, {3.577601930674769*^9, 3.577601943869088*^9}, 
   3.5776020329629965`*^9, 3.577602221897715*^9, 3.577602274419715*^9, 
   3.577602321340715*^9, 3.577602455745715*^9, 3.5908990766416903`*^9, 
   3.5908991857546005`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5776018794466467`*^9, {3.577601930674769*^9, 3.577601943869088*^9}, 
   3.5776020329629965`*^9, 3.577602221897715*^9, 3.577602274419715*^9, 
   3.577602321340715*^9, 3.577602455745715*^9, 3.5908990766416903`*^9, 
   3.590899185755601*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5776018794466467`*^9, {3.577601930674769*^9, 3.577601943869088*^9}, 
   3.5776020329629965`*^9, 3.577602221897715*^9, 3.577602274419715*^9, 
   3.577602321340715*^9, 3.577602455745715*^9, 3.5908990766416903`*^9, 
   3.5908991857566013`*^9}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["S-R flip flop", "Section",
 CellChangeTimes->{{3.520880011078125*^9, 3.520880015078125*^9}, {
  3.520938836109375*^9, 3.52093884040625*^9}, {3.5295848125*^9, 
  3.529584814875*^9}, {3.52959633665625*^9, 3.52959634803125*^9}, {
  3.529687234875*^9, 3.529687236765625*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Signal\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<SRflipflop\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<SR flip flop\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentSignal\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.520880152296875*^9, 3.520880230078125*^9}, 
   3.520932125875*^9, 3.520932753984375*^9, {3.52093324790625*^9, 
   3.520933251453125*^9}, 3.522342790078125*^9, {3.52958482121875*^9, 
   3.5295848575625*^9}, {3.529588367046875*^9, 3.5295883780625*^9}, {
   3.529590218*^9, 3.5295902181875*^9}, {3.529596354421875*^9, 
   3.529596369015625*^9}, {3.529687345296875*^9, 3.52968736725*^9}, 
   3.5764735121969414`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "setCond", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<On condition\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "resetCond", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<off condition\>\""}], "}"}]}], "\n", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.520880034703125*^9, 3.520880034703125*^9}, {
   3.520932825078125*^9, 3.520932825328125*^9}, 3.529585849328125*^9, {
   3.529596531265625*^9, 3.529596537390625*^9}, {3.529650349909154*^9, 
   3.529650351237194*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", ":=", " ", 
   RowBox[{"{", "\n", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "Qstate", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Logical state\>\""}], "}"}], ",", "\n", 
     RowBox[{"{", 
      RowBox[{
      "notQstate", ",", "0.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Logical inverse of state\>\""}], "}"}]}], "\n", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52088004696875*^9, 3.520880046984375*^9}, 
   3.520932825859375*^9, {3.52958588634375*^9, 3.529585902890625*^9}, {
   3.52959659559375*^9, 3.529596615265625*^9}, 3.5296472601147585`*^9, {
   3.5296473407948947`*^9, 3.5296473473268137`*^9}, 3.529649459263307*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"oldQstate", "==", "Qstate"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldSetCond", "==", "setCond"}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldResetCond", "==", "resetCond"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.52234700896875*^9, 3.52234701828125*^9}, {
   3.52234704890625*^9, 3.522347131203125*^9}, {3.522347193828125*^9, 
   3.522347242390625*^9}, {3.529587134296875*^9, 3.52958716409375*^9}, 
   3.529587754421875*^9, 3.5295963953125*^9, {3.529647256989439*^9, 
   3.5296472580207944`*^9}, {3.529647337935227*^9, 3.529647353718093*^9}, {
   3.5296872766875*^9, 3.529687338453125*^9}, {3.529687383921875*^9, 
   3.5296873858125*^9}, {3.5719247270915413`*^9, 3.571924745717974*^9}, 
   3.5719252640444846`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"DsetCond", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{"setCond", "-", "oldSetCond"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"DresetCond", "==", 
      RowBox[{"onPositive", "[", 
       RowBox[{"resetCond", "-", "oldResetCond"}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"Qstate", "==", 
      RowBox[{"limit", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"onPositive", "[", 
          RowBox[{"oldQstate", "-", "0.5"}], "]"}], "+", 
         RowBox[{"onPositive", "[", 
          RowBox[{"DsetCond", "-", "0.5"}], "]"}], "-", 
         RowBox[{"onPositive", "[", 
          RowBox[{"DresetCond", "-", "0.5"}], "]"}], "-", "0.5"}], ",", "0", 
        ",", "1"}], "]"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"oldQstate", "\[Equal]", "Qstate"}], ",", "\[IndentingNewLine]", 
     RowBox[{"notQstate", "==", 
      RowBox[{"1", "-", "Qstate"}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.529586025328125*^9, 3.52958604828125*^9}, {
   3.529586463703125*^9, 3.5295865311875*^9}, {3.5295869555*^9, 
   3.52958704159375*^9}, {3.529587082453125*^9, 3.52958712321875*^9}, {
   3.529587709234375*^9, 3.52958771875*^9}, {3.52958824928125*^9, 
   3.529588250875*^9}, {3.52958830328125*^9, 3.529588310671875*^9}, {
   3.529596403*^9, 3.52959645915625*^9}, {3.529596510671875*^9, 
   3.529596527171875*^9}, {3.5295965615625*^9, 3.529596585640625*^9}, {
   3.5296472501293616`*^9, 3.5296472536140933`*^9}, {3.52964732004277*^9, 
   3.52964737482963*^9}, {3.5296486047915845`*^9, 3.529648605072869*^9}, 
   3.529650357502418*^9, {3.5296505716074257`*^9, 3.5296505771857653`*^9}, {
   3.529687265359375*^9, 3.529687267546875*^9}, {3.529687403515625*^9, 
   3.529687484203125*^9}, {3.529687527171875*^9, 3.52968755115625*^9}, {
   3.5297491187115407`*^9, 3.529749138767107*^9}, {3.571924759679999*^9, 
   3.571924782643239*^9}, 3.571925072491748*^9, {3.5776023997777147`*^9, 
   3.577602402345715*^9}, {3.5908987674618163`*^9, 3.5908987783658657`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5774507575908074`*^9, {3.577602407800715*^9, 3.577602455858715*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Set", "::", "noval"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Symbol \[NoBreak]\\!\\(inputVariables\\)\[NoBreak] in part \
assignment does not have an immediate value. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/noval\\\", ButtonNote -> \
\\\"Set::noval\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5774507575908074`*^9, {3.577602407800715*^9, 3.577602455859715*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\(\\(\\\"Sig\\\" \[Ellipsis] \
\\\"flop\\\"\\)\\)\\)\\), \\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\)}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"SignalSRflipflop.svg\\\"\\)\\), \
\\(\\(\\\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \
\[Rule] \\\"SignalSRflipflop.svg\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \
\\(\\({}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\
\\\"x\\\" \[Rule] 0.3333333333333333`\\)\\), \\(\\(\\\"y\\\" \[Rule] \
\\\"0\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"setCond\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] 0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\
\"0\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"270\\\"\\)\\), \\(\\(\\\"name\\\" \
\[Rule] \\\"resetCond\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.333333\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"Qstate\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.666667\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"notQstate\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5774507575908074`*^9, {3.577602407800715*^9, 3.5776024558687153`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5774507575908074`*^9, {3.577602407800715*^9, 3.577602455870715*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5774507575908074`*^9, {3.577602407800715*^9, 3.577602455871715*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5774507575908074`*^9, {3.577602407800715*^9, 3.577602455872715*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"x\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5774507575908074`*^9, {3.577602407800715*^9, 3.577602455872715*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5774507575908074`*^9, {3.577602407800715*^9, 3.577602455873715*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.5774507575908074`*^9, {3.577602407800715*^9, 3.577602455874715*^9}}],

Cell[BoxData["\<\"SignalSRflipflop.xml\"\>"], "Output",
 CellChangeTimes->{{3.554785674213954*^9, 3.554785699978754*^9}, 
   3.5774507576248107`*^9, {3.5776024078217154`*^9, 3.5776024558757153`*^9}}]
}, Open  ]]
}, Closed]]
}, Open  ]]
},
CellGrouping->Manual,
WindowSize->{1171, 826},
WindowMargins->{{26, Automatic}, {-9, Automatic}},
FrontEndVersion->"8.0 for Microsoft Windows (64-bit) (October 6, 2011)",
StyleDefinitions->Notebook[{
   Cell[
    StyleData[
    StyleDefinitions -> 
     FrontEnd`FileName[{"Creative"}, "PastelColor.nb", CharacterEncoding -> 
       "WindowsANSI"]]]}, Visible -> False, FrontEndVersion -> 
  "8.0 for Microsoft Windows (64-bit) (October 6, 2011)", StyleDefinitions -> 
  "PrivateStylesheetFormatting.nb"]
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[579, 22, 273, 3, 65, "Title"],
Cell[CellGroupData[{
Cell[877, 29, 96, 1, 75, "Section"],
Cell[976, 32, 481, 13, 82, "Input"],
Cell[1460, 47, 173, 3, 41, "Input"],
Cell[1636, 52, 900, 17, 41, "Input"],
Cell[2539, 71, 124, 3, 41, "Input"]
}, Open  ]],
Cell[CellGroupData[{
Cell[2700, 79, 292, 4, 75, "Section"],
Cell[2995, 85, 1147, 27, 162, "Input"],
Cell[4145, 114, 89, 2, 41, "Input"],
Cell[4237, 118, 1359, 30, 142, "Input"],
Cell[5599, 150, 1186, 25, 122, "Input"],
Cell[6788, 177, 1145, 19, 142, "Input"],
Cell[7936, 198, 219, 5, 41, "Input"],
Cell[8158, 205, 3038, 53, 242, "Input"],
Cell[CellGroupData[{
Cell[11221, 262, 63, 1, 41, "Input"],
Cell[11287, 265, 967, 18, 21, "Message"],
Cell[12257, 285, 969, 18, 21, "Message"],
Cell[13229, 305, 967, 18, 21, "Message"],
Cell[14199, 325, 1014, 19, 21, "Message"],
Cell[15216, 346, 4549, 69, 141, "Message"],
Cell[19768, 417, 945, 18, 21, "Message"],
Cell[20716, 437, 1060, 19, 21, "Message"],
Cell[21779, 458, 945, 18, 21, "Message"],
Cell[22727, 478, 1060, 19, 21, "Message"],
Cell[23790, 499, 945, 18, 21, "Message"],
Cell[24738, 519, 1019, 19, 21, "Message"],
Cell[25760, 540, 1094, 20, 21, "Message"],
Cell[26857, 562, 1024, 19, 21, "Message"],
Cell[27884, 583, 192, 2, 40, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[28125, 591, 332, 5, 75, "Section"],
Cell[28460, 598, 1202, 28, 162, "Input"],
Cell[29665, 628, 89, 2, 41, "Input"],
Cell[29757, 632, 770, 17, 102, "Input"],
Cell[30530, 651, 1016, 21, 102, "Input"],
Cell[31549, 674, 811, 15, 101, "Text"],
Cell[32363, 691, 1020, 18, 121, "Input"],
Cell[33386, 711, 3472, 65, 241, "Input"],
Cell[CellGroupData[{
Cell[36883, 780, 63, 1, 41, "Input"],
Cell[36949, 783, 1167, 21, 70, "Message"],
Cell[38119, 806, 1167, 21, 70, "Message"],
Cell[39289, 829, 4653, 70, 70, "Message"],
Cell[43945, 901, 1145, 21, 70, "Message"],
Cell[45093, 924, 1292, 23, 70, "Message"],
Cell[46388, 949, 1145, 21, 70, "Message"],
Cell[47536, 972, 1294, 23, 70, "Message"],
Cell[48833, 997, 1145, 21, 70, "Message"],
Cell[49981, 1020, 1219, 22, 70, "Message"],
Cell[51203, 1044, 193, 2, 70, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[51445, 1052, 329, 5, 45, "Section"],
Cell[51777, 1059, 1260, 29, 162, "Input"],
Cell[53040, 1090, 89, 2, 41, "Input"],
Cell[53132, 1094, 782, 15, 82, "Input"],
Cell[53917, 1111, 1231, 25, 121, "Input"],
Cell[55151, 1138, 1196, 20, 121, "Input"],
Cell[56350, 1160, 2722, 46, 182, "Input"],
Cell[CellGroupData[{
Cell[59097, 1210, 63, 1, 41, "Input"],
Cell[59163, 1213, 531, 11, 70, "Message"],
Cell[59697, 1226, 4057, 62, 70, "Message"],
Cell[63757, 1290, 509, 11, 70, "Message"],
Cell[64269, 1303, 626, 12, 70, "Message"],
Cell[64898, 1317, 511, 11, 70, "Message"],
Cell[65412, 1330, 225, 3, 70, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[65686, 1339, 374, 5, 45, "Section"],
Cell[66063, 1346, 1347, 30, 162, "Input"],
Cell[67413, 1378, 89, 2, 41, "Input"],
Cell[67505, 1382, 1064, 22, 102, "Input"],
Cell[68572, 1406, 1231, 25, 121, "Input"],
Cell[69806, 1433, 1426, 23, 142, "Input"],
Cell[71235, 1458, 3177, 56, 202, "Input"],
Cell[CellGroupData[{
Cell[74437, 1518, 63, 1, 41, "Input"],
Cell[74503, 1521, 531, 11, 70, "Message"],
Cell[75037, 1534, 529, 11, 70, "Message"],
Cell[75569, 1547, 3066, 48, 70, "Message"],
Cell[78638, 1597, 507, 11, 70, "Message"],
Cell[79148, 1610, 654, 13, 70, "Message"],
Cell[79805, 1625, 507, 11, 70, "Message"],
Cell[80315, 1638, 654, 13, 70, "Message"],
Cell[80972, 1653, 507, 11, 70, "Message"],
Cell[81482, 1666, 581, 12, 70, "Message"],
Cell[82066, 1680, 194, 2, 70, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[82309, 1688, 373, 5, 45, "Section"],
Cell[82685, 1695, 1256, 29, 162, "Input"],
Cell[83944, 1726, 89, 2, 41, "Input"],
Cell[84036, 1730, 770, 17, 102, "Input"],
Cell[84809, 1749, 1416, 29, 142, "Input"],
Cell[86228, 1780, 1037, 18, 121, "Input"],
Cell[87268, 1800, 3598, 68, 241, "Input"],
Cell[CellGroupData[{
Cell[90891, 1872, 63, 1, 41, "Input"],
Cell[90957, 1875, 531, 11, 70, "Message"],
Cell[91491, 1888, 531, 11, 70, "Message"],
Cell[92025, 1901, 3000, 46, 70, "Message"],
Cell[95028, 1949, 509, 11, 70, "Message"],
Cell[95540, 1962, 656, 13, 70, "Message"],
Cell[96199, 1977, 509, 11, 70, "Message"],
Cell[96711, 1990, 656, 13, 70, "Message"],
Cell[97370, 2005, 511, 11, 70, "Message"],
Cell[97884, 2018, 585, 12, 70, "Message"],
Cell[98472, 2032, 194, 2, 70, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[98715, 2040, 424, 6, 45, "Section"],
Cell[99142, 2048, 1300, 29, 162, "Input"],
Cell[100445, 2079, 89, 2, 41, "Input"],
Cell[100537, 2083, 770, 17, 102, "Input"],
Cell[101310, 2102, 1016, 21, 102, "Input"],
Cell[102329, 2125, 1022, 18, 121, "Input"],
Cell[103354, 2145, 3576, 68, 241, "Input"],
Cell[CellGroupData[{
Cell[106955, 2217, 63, 1, 41, "Input"],
Cell[107021, 2220, 529, 11, 70, "Message"],
Cell[107553, 2233, 531, 11, 70, "Message"],
Cell[108087, 2246, 2354, 37, 70, "Message"],
Cell[110444, 2285, 507, 11, 70, "Message"],
Cell[110954, 2298, 654, 13, 70, "Message"],
Cell[111611, 2313, 507, 11, 70, "Message"],
Cell[112121, 2326, 654, 13, 70, "Message"],
Cell[112778, 2341, 507, 11, 70, "Message"],
Cell[113288, 2354, 581, 12, 70, "Message"],
Cell[113872, 2368, 194, 2, 70, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[114115, 2376, 427, 6, 45, "Section"],
Cell[114545, 2384, 1350, 30, 162, "Input"],
Cell[115898, 2416, 89, 2, 41, "Input"],
Cell[115990, 2420, 1064, 22, 102, "Input"],
Cell[117057, 2444, 1231, 25, 121, "Input"],
Cell[118291, 2471, 1458, 24, 142, "Input"],
Cell[119752, 2497, 3158, 56, 202, "Input"],
Cell[CellGroupData[{
Cell[122935, 2557, 63, 1, 41, "Input"],
Cell[123001, 2560, 533, 11, 70, "Message"],
Cell[123537, 2573, 531, 11, 70, "Message"],
Cell[124071, 2586, 3068, 48, 70, "Message"],
Cell[127142, 2636, 509, 11, 70, "Message"],
Cell[127654, 2649, 656, 13, 70, "Message"],
Cell[128313, 2664, 509, 11, 70, "Message"],
Cell[128825, 2677, 658, 13, 70, "Message"],
Cell[129486, 2692, 509, 11, 70, "Message"],
Cell[129998, 2705, 583, 12, 70, "Message"],
Cell[130584, 2719, 191, 2, 70, "Output"]
}, Open  ]]
}, Closed]],
Cell[130802, 2725, 153, 2, 23, "Subtitle"],
Cell[130958, 2729, 941, 17, 41, "Input"],
Cell[CellGroupData[{
Cell[131924, 2750, 186, 3, 75, "Section"],
Cell[132113, 2755, 1109, 26, 162, "Input"],
Cell[133225, 2783, 89, 2, 41, "Input"],
Cell[133317, 2787, 915, 21, 121, "Input"],
Cell[134235, 2810, 1103, 23, 121, "Input"],
Cell[135341, 2835, 1032, 18, 162, "Input"],
Cell[136376, 2855, 2239, 50, 262, "Input"],
Cell[CellGroupData[{
Cell[138640, 2909, 63, 1, 41, "Input"],
Cell[138706, 2912, 502, 10, 70, "Message"],
Cell[139211, 2924, 502, 10, 70, "Message"],
Cell[139716, 2936, 502, 10, 70, "Message"],
Cell[140221, 2948, 551, 11, 70, "Message"],
Cell[140775, 2961, 3035, 46, 70, "Message"],
Cell[143813, 3009, 480, 10, 70, "Message"],
Cell[144296, 3021, 597, 11, 70, "Message"],
Cell[144896, 3034, 480, 10, 70, "Message"],
Cell[145379, 3046, 595, 11, 70, "Message"],
Cell[145977, 3059, 482, 10, 70, "Message"],
Cell[146462, 3071, 556, 11, 70, "Message"],
Cell[147021, 3084, 597, 11, 70, "Message"],
Cell[147621, 3097, 557, 11, 70, "Message"],
Cell[148181, 3110, 200, 3, 70, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[148430, 3119, 227, 3, 45, "Section"],
Cell[148660, 3124, 1143, 27, 162, "Input"],
Cell[149806, 3153, 89, 2, 41, "Input"],
Cell[149898, 3157, 700, 16, 102, "Input"],
Cell[150601, 3175, 754, 18, 102, "Input"],
Cell[151358, 3195, 623, 11, 82, "Input"],
Cell[151984, 3208, 892, 16, 122, "Input"],
Cell[152879, 3226, 1600, 31, 122, "Input"],
Cell[154482, 3259, 2318, 46, 162, "Input"],
Cell[CellGroupData[{
Cell[156825, 3309, 63, 1, 41, "Input"],
Cell[156891, 3312, 703, 14, 21, "Message"],
Cell[157597, 3328, 701, 14, 21, "Message"],
Cell[158301, 3344, 4244, 66, 158, "Message"],
Cell[162548, 3412, 681, 14, 21, "Message"],
Cell[163232, 3428, 828, 16, 21, "Message"],
Cell[164063, 3446, 679, 14, 21, "Message"],
Cell[164745, 3462, 828, 16, 21, "Message"],
Cell[165576, 3480, 679, 14, 21, "Message"],
Cell[166258, 3496, 755, 15, 21, "Message"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[167062, 3517, 277, 4, 75, "Section"],
Cell[167342, 3523, 1195, 28, 162, "Input"],
Cell[168540, 3553, 89, 2, 41, "Input"],
Cell[168632, 3557, 700, 16, 102, "Input"],
Cell[169335, 3575, 728, 17, 102, "Input"],
Cell[170066, 3594, 892, 16, 122, "Input"],
Cell[170961, 3612, 2158, 42, 162, "Input"],
Cell[CellGroupData[{
Cell[173144, 3658, 63, 1, 41, "Input"],
Cell[173210, 3661, 531, 11, 21, "Message"],
Cell[173744, 3674, 531, 11, 21, "Message"],
Cell[174278, 3687, 2359, 37, 90, "Message"],
Cell[176640, 3726, 509, 11, 21, "Message"],
Cell[177152, 3739, 656, 13, 21, "Message"],
Cell[177811, 3754, 509, 11, 21, "Message"],
Cell[178323, 3767, 656, 13, 21, "Message"],
Cell[178982, 3782, 509, 11, 21, "Message"],
Cell[179494, 3795, 583, 12, 21, "Message"],
Cell[180080, 3809, 199, 2, 40, "Output"]
}, Open  ]]
}, Closed]]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
